package com.song.dp.config;

import com.song.dp.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author TonySong
 * @date 2024/8/8 0008
 * @time 15:52
 */
@RestControllerAdvice
@Slf4j
public class GlobaException {

    @ExceptionHandler(RuntimeException.class)
    public Result handle(RuntimeException e) {
        log.error("RuntimeException", e);
        return Result.fail("服务器错误！");
    }


}
